package top.hmtools.makedata.random.chineseName.impl;

import top.hmtools.makedata.random.chineseName.Lastname;
import top.hmtools.makedata.random.chineseName.constants.LastnameDictionary;

/**
 * @Author Zhoufan [https://github.com/fantaga].
 * @Date 2016/12/26
 * @Description:
 */
public class SingleCharacterLastname extends Lastname {

	@Override
	protected String generateByGender(boolean gender) {
		if (gender == true)
			lastname = LastnameDictionary.getSingleLastnameForBoy();
		if (gender == false)
			lastname = LastnameDictionary.getSingleLastnameForGirl();
		return lastname;
	}

	@Override
	public String generateBoyName() {
		return generateByGender(true);
	}

	@Override
	public String generateGirlName() {
		return generateByGender(false);
	}

	@Override
	public String name() {
		return lastname;
	}

	public String generate() {
		lastname = Math.random() > 0.50 ?
				generateByGender(true) : generateByGender(false);
		return lastname;
	}
}
